<?php

if (is_ajax()):
	if ($this->Auth->login($_POST['username'], $_POST['password'])):
		echo json_encode(array('success' => 1));
	else:
		echo json_encode(array('success' => 0, 'error' => $this->Auth->error));	
	endif;
endif

?>